package com.woniu.mapper.sportsHealth;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.woniu.model.sportsHealth.entity.Sleep;
import com.woniu.model.sportsHealth.model.dto.SleepDto;
import com.woniu.model.sportsHealth.model.vo.SleepVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 睡眠表 Mapper 接口
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@Mapper
public interface SleepMapper extends BaseMapper<Sleep> {

    List<SleepDto> findAll(Map<String,Object> param);

    @Select("select account,name,sleep_date,deep_sleep_duration,light_sleep_duration,clearness_duration,light_sleep_duration,last_night_sleep_time,today_sleep_time from sh_sleep " +
            " inner join sh_user su on sh_user_id = su.user_id")
    List<SleepVo> findAllExport();

}
